# We need to import the library in order to use in in Python
import random

# And you have a series of short tasks to complete - remember to run your program to check that they are working!

''' Task A

You have been given a little bit of unfinished code to complete and add to.

- Generate 3 random numbers between 0 and 100 and print them out
- Comment and uncomment 'random.seed(10)'
- Run your program with it commented and with it uncommented.
- Write a comment explaining what you think it is doing.
- confirm this by changing the value in the brackets.
'''

# random.seed() is ...
random.seed(10)

num1 = random.randint(0,100)
num2 = random.randint(0,100)
num3 = random.randint(0,100)

print(f"{num1} ~ {num2} ~ {num3}")




''' Task B
- Ask the user to enter a positive integer, and generate that many random numbers.
- Optionally: save these into a file called 'random.txt'
'''

import random

# 2. 问用户要几个数字
count = int(input("请输入想生成几个随机数："))

# 3. 准备一个空篮子，用来装随机数
numbers = []

# 4. 循环 count 次，每次往篮子里放一个 0~100 的随机数
for i in range(count):
    n = random.randint(0, 100)  # 生成一个随机数
    numbers.append(n)           # 放进篮子

# 5. 把篮子里的数字全部打印出来
print("生成的随机数是：")
print(numbers)

